fix(dev): detect local postgres during setup - #4621
Open
raun6k wants to merge 1 commit into
Open
Conversation
Signed-off-by: Raunak Bhagate <141800878+raun6k@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an early setup check for a local PostgreSQL server already listening on the configured Postgres port.
This prevents
just setupfrom continuing when migrations could connect to a local PostgreSQL instance instead of the Docker-managedbuzz-postgrescontainer.Problem
When a local PostgreSQL service is listening on port
5432, Docker can still report the Buzz PostgreSQL container as healthy.However, the migration command connects through
localhost:5432. On affected machines, that connection may reach the local PostgreSQL server instead of the Buzz container.This can produce a misleading error such as:
Changes
scripts/dev-setup.sh.postgresandpostmasterprocesses listening on${PGPORT:-5432}.This change does not modify Docker port mappings or add configurable port support.
Testing
Local PostgreSQL running
Started a Homebrew PostgreSQL 16 service on port
5432while the Buzz PostgreSQL container was also running.Verified that
just setupstopped immediately with:Verified that database migrations were not started.
Local PostgreSQL stopped
Stopped the Homebrew PostgreSQL service and confirmed that only Docker was listening on port
5432.Verified that
just setupcompleted successfully, including:Static checks
Both checks passed.